import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Sort from '../views/Sort.vue'
import Shop from '../views/Shop.vue'
import Member from '../views/Member.vue'
import NewList from '../views/NewList.vue'
import NewDetails from '../views/NewDetails'
import Login from '../views/Login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/sort',
    name: 'Sort',
    component: Sort
  },
  {
    path: '/shop',
    name: 'Shop',
    component: Shop
  },
  {
    path: '/member',
    name: 'Member',
    component: Member
  },
  {
    path: '/home/newList',
    name: 'NewList',
    component: NewList
  },
  {
    path: '/home/newList/newDetails/:newsId',
    name: 'NewDetails',
    component: NewDetails
  },
  {
    path: '/member/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
